﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Outlook = Microsoft.Office.Interop.Outlook;
using Office = Microsoft.Office.Core;

namespace SaintchadEmailOrganizer
{
    public partial class ThisAddIn
    {
		private EmailStatistics emailTaskPane;
		private Microsoft.Office.Tools.CustomTaskPane statsCustomTaskPane;

        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
			emailTaskPane = new EmailStatistics();
			statsCustomTaskPane = this.CustomTaskPanes.Add(emailTaskPane, "Email Statistics");
			statsCustomTaskPane.Visible = true;
			statsCustomTaskPane.VisibleChanged += new EventHandler(statsCustomTaskPane_VisibleChanged);
        }

		private void statsCustomTaskPane_VisibleChanged(object sender, System.EventArgs e)
		{
			Globals.Ribbons.Organize_Ribbon.tglEmailStatsPane.Checked = statsCustomTaskPane.Visible;
		}

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {
        }

		public Microsoft.Office.Tools.CustomTaskPane TaskPane
		{
			get
			{
				return statsCustomTaskPane;
			}
		}

        #region VSTO generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InternalStartup()
        {
            this.Startup += new System.EventHandler(ThisAddIn_Startup);
            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
        }
        
        #endregion
    }
}
